package 装饰模式;

//基础类，目的是调用自己参数传进来的类
public abstract class Decorator extends ConcreteComponent {
    protected ConcreteComponent component;

    public  Decorator(ConcreteComponent component) {
        this.component = component;
    }

    @Override
    public void Operation() {
        //调用参数中的方法
        if (component != null){
            component.Operation();
        }
    }

}
